<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=7" />
<meta name="viewport" content="width=device-width,initial-scale=0.2, minimum-scale=0.23, maximum-scale=1.0, user-scalable=no">
<link href="/images/logo.ico" rel="shortcut icon">
<title>修改用户信息</title>
<link type="text/css" href="/common/css/common.css" rel="stylesheet"/>
<style type="text/css">
	 td{padding:0px;}
	 dl{margin:0px; padding:0px; width:622px; overflow:hidden;}
	  dt{padding-left:10px;}
	  dt,dd{height:22px; line-height:22px;}
	  dt label{float:left; width:300px;}
	  dd label{float:left; width:252px;padding-left:40px;}
	  dt input,dd input{flot:left;cursor:pointer;}
</style>
<link rel="stylesheet" href="/manage/assets/css/bootstrap.min.css">
<script type="text/javascript" src="/common/js/common.js"></script>
<script type="text/javascript" src="/common/js/jquery1.8.3.js"></script>
<script type="text/javascript">
function checkForm(){
	var userName=document.getElementById("userName");
	var pwd=document.getElementById("password");

	if(userName.value==""){
		alert("用户名不能为空！");
		userName.focus();
		return false;
	}else{}


	return true;
}
function setSonCHK(o,type){
	var dls=o.parentNode.parentNode.getElementsByTagName("dd");
	for(var i=0;i<dls.length;i++){
		var inputs=dls[i].getElementsByTagName("input");
		if(type===0){
			inputs[0].checked=o.checked;
		}else{
			if(o.checked){
				o.parentNode.getElementsByTagName("input")[0].checked=true;
				inputs[0].checked=o.checked;
			}
			inputs[1].checked=o.checked;
		}
	}
}
function sendCode(){
	var reads=document.getElementsByName("readCode");
	var edits=document.getElementsByName("editCode");
	var readCode="",editCode="";
	for(var i=0;i<reads.length;i++){
		if(reads[i].checked){
			if(readCode!="")readCode+=",";
			readCode+=reads[i].value;
		}
		if(edits[i].checked){
			if(editCode!="")editCode+=",";
			editCode+=edits[i].value;
		}
	}	
	if($E("allSet").checked){
		$E("partCode").value="ALL";
		return true;
	}else{
		if(readCode==""){
			alert("必须为账户设置初始权限！");
			return false;
		}else{
			$E("partCode").value=editCode+","+readCode;
			return true;
		}	
	}
}
function autoSetRead(o){
if(o.checked){
	o.parentNode.getElementsByTagName("input")[0].checked=true;
}	
}
function initChecked(){
 try{
	var setVelveControl=document.getElementById("partCode");
	if(setVelveControl.value=="ALL"){
		$E("allSet").checked=true;
		setAll($E("allSet"));
	}else{
		var oldPartCode=setVelveControl.value;
		if(setVelveControl&& oldPartCode!=""){
			var reads=document.getElementsByName("readCode");
			var edits=document.getElementsByName("editCode");
			var readCode="",editCode="";
			for(var i=0;i<reads.length;i++){
				if(oldPartCode.indexOf(reads[i].value)!=-1){
					reads[i].checked=true;
				}
				if(oldPartCode.indexOf(edits[i].value)!=-1){
					edits[i].checked=true;
				}
			}
		}
	}	
}catch(e){}
}
function setAll(o){
	var isok=false;
 	if(o.checked){
		isok=true;
	}
	var edits=document.getElementsByName("editCode");
	var reads=document.getElementsByName("readCode");
	var parentReads=document.getElementsByName("parentRead");
	var parentEdits=document.getElementsByName("parentEdit");
	for(var i=0;i<edits.length;i++){
		edits[i].disabled=isok;
		reads[i].disabled=isok;
	}
	for(var i=0;i<parentEdits.length;i++){
		parentEdits[i].disabled=isok;
		parentReads[i].disabled=isok;
	}
 }
</script>
</head>

<body>

<form id="userForm" name="userForm" theme="simple" method="post" action="/user/update" onsubmit="return checkForm();">
<div class="card" >
	<div class="card-header">
		<strong class="card-title">修改用户信息</strong>
		<input type="hidden" name="id" th:value="${user.id}"/>
	</div>
	<div class="card-body">
		<table id="bootstrap-data-table" class="table">

                    <tr>
                        <td align="right" width="100">登 录 名：</td>
                        <td><input type="text" theme="simple" name="username" th:value="${user.username}" id="userName" style="width:180px;" readonly="true"/><b>*</b></td>
                        <td rowspan="2">备　注：<textarea  theme="simple" name="remark" id="remark" cols="66" rows="8" tabindex="8" th:text="${user.remark}"></textarea></td>
                    </tr>
                    <tr>
                    	<td align="right"></td>
                  		<td></td>
                    </tr>
                    <tr>
                      <td align="right">姓　　名：</td>
                      <td><input theme="simple" name="name" id="name" th:value="${user.name}" style="width:180px;"/><b>*</b></td>
                    </tr><!-- -->
                    <!--<tr>   
                      <td align="right">角色：</td>
                      <td><s:radio list="#{1:'管理用户','2':'个人用户'}" name="u.depart" id="depart"></s:radio><b>*</b></td>
                    </tr>-->
                    <!--<tr>
                      <td align="right">联系方式：</td>
                      <td><s:textfield theme="simple" name="u.linkman" id="linkman" cssStyle="width:180px;"/></td>
                    </tr>-->
					 <!--<tr>
                      <td align="right">域名指向：</td>
                      <td><s:textfield theme="simple" name="u.urlName" id="linkman" cssStyle="width:180px;"/></td>
                    </tr>-->
                   
                    
                    <tr>     
                        <td align="left" colspan="3" style="padding:10px;">
                        <input type="submit" name="Submit" value="修 改" class="btn2_74"/>
                        <input type="reset" value="返 回" class="btn2_74" style="margin-left:10px;" onclick="history.back()"/>
                        </td>
                    </tr>
                  </table></div></div>
                </form>
</body>
</html>
